import HTMLTestRunner_PY3
import yamail

class Tools():
    #生成报告
    def report(self):
        baogao = HTMLTestRunner_PY3.HTMLTestRunner(open(r'E:\Django\DjangoProject\hzy_po\Report\PO.html','wb'),
                                                   title='测试报告',
                                                   description='测试均通过')
        return baogao
    #发送邮件
    def email(self):
        fasong = yamail.SMTP(user='2940554532@qq.com',password='xwntrbbdrwcadhch',host='smtp.qq.com',port=465)
        fasong.send(to='2940554532@qq.com',subject='发送邮件',contents=r'E:\Django\DjangoProject\hzy_po\Report\PO.html')
        fasong.close()
        print('发送成功')